<template>
    <div>{{title + name}}</div>
    <cssEx />
    <slotEx>
        <template v-slot:left>
            <div class="text1">这里时slot的内容left</div>
        </template>
        <template v-slot:center>
            <div>这里时slot的内容center</div>
        </template>
        <template v-slot:right>
            <div>这里时slot的内容</div>
        </template>
    </slotEx>
    <keep-alive include="onTrigger">
        <onTrigger />
        
    </keep-alive>
</template>
<script>
import cssEx from './css-ex.vue'
import slotEx from './slotted.vue'
import onTrigger from './onTrigger.vue'
export default {
  name: '',
  components: {
    cssEx,
    slotEx,
    onTrigger
  },
  props: {
    title: {
        type: String,
        default: '小狮子'
    },
    name: {
        type: String,
        default: '小老虎'
    },
  },
  emits: ['myEvents', 'update:title', 'update:name'],
  setup(props, { emit }) {
    emit('myEvents',2);
    // emit('update:title', '狮子王')
    // emit('update:name', '吴旭')
    const doSomeThing = () => {
        console.log('do some thing')
    }
    return {
        doSomeThing
    }
  }
}
</script>

<script setup>
import { defineProps, defineEmits } from "vue";
// // 声明props对象
// const props = defineProps({
//     names: {
//         type: String,
//         default: ""
//     },
//     age: Number
// })
// // 声明emits对象
</script>
<style scoped>

</style>